package com.cskaoyan.market.controller;

import com.cskaoyan.market.service.AdminDashBoardService;
import com.cskaoyan.market.service.AdminDashBoardServiceImpl;
import com.cskaoyan.market.util.JacksonUtil;
import com.cskaoyan.market.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;

/**
 * @author: YaLiFeng
 * @description: TODO
 * @date: 2024/5/8 17:16
 */
@RestController
@RequestMapping("/admin")
public class AdminDashBoardController extends HttpServlet {
    @Autowired
    private AdminDashBoardService adminDashBoardService;

    @GetMapping("dashboard")
    public Object totalCount() throws IOException {
        Map<String,Integer> items=adminDashBoardService.count();
        return ResponseUtil.okMap(items);


    }
}
